<%@ page import="com.dao.UserDao" %>
<%@ page import="com.bean.User" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="com.bean.Friends" %>
<%@ page import="com.dao.FriendsDao" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%
  String qq = request.getParameter("qq");
  UserDao userDao = new UserDao();
  User user = userDao.findOne(qq);
  PrintWriter writer =response.getWriter();
  if(user.getId()==0){

    writer.write("-1");
  }else {
    //返回json串
    StringBuffer sb = new StringBuffer();
    sb.append("{").append("\"qq\":"+"\""+user.getQq()+"\"").append(",")
            .append("\"username\":"+"\""+user.getUsername()+"\"").append(",")
            .append("\"headPic\":"+"\""+user.getHeadPic()+"\"").append(",")
            .append("\"id\":"+"\""+user.getId()+"\"").append("}");
    writer.write(sb.toString());
  }
  writer.close();
%>